<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-row>
      <el-col :span='22' :xs='24'>
        <el-form ref="form" :model="s_pack" :rules="rules" label-width="100px" id="mvcfm">
          <el-button @click="productTransportUpSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>保存</el-button>
          <div class="form-unit">
            <span class="mvc-title-left"> 产品包装信息 </span>
          </div>
          <div>
            <el-row>
              <el-col :span="12">
                <el-form-item label="包装方式" prop="pack_way">
                  <el-input v-model="s_pack.pack_way" />
                </el-form-item>
              </el-col>
            </el-row>
          </div>
          <div class="form-unit">
            <span class="mvc-title-left"> 产品运输信息 </span>
          </div>
          <div>
            <el-row>
              <el-col :span="12">
                <el-form-item label="装运期" prop="pack_loadate">
                  <el-select style='width:100%' v-model="s_pack.pack_loadate">
                    <el-option label="24小时" value="24小时" />
                    <el-option label="2天" value="2天" />
                    <el-option label="1周" value="1周" />
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="装运" prop="pack_load">
                  <el-select style='width:100%' v-model="s_pack.pack_load">
                    <el-option label="邮寄" value="邮寄" />
                    <el-option label="特快专递" value="特快专递" />
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="所属格式" prop="pack_form">
                  <el-select style='width:100%' v-model="s_pack.pack_form">
                    <el-option label="60*4" value="60*4" />
                    <el-option label="10*100" value="10*100" />
                    <el-option label="10*200" value="10*200" />
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </el-form>
      </el-col>
      <el-col :span='2' :xs='24'>
        <el-menu default-active='active' class='menu-unit'>
          <el-menu-item v-for='item in Container'>
            <el-link @click="gotoMenu(item.url)" :type="'包装运输'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'ProductTransportUp',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        s_pack: {
          pack_way: null,
          pack_loadate: null,
          pack_load: null,
          pack_form: null,
        },
        loading: false,
        Container: null,
        rules: {}
      }
    },
    created() {
      this.getData();
      this.loadContainerMenu({
        pid: "C1BDE411EFF7473EAF5F658AF81F2689",
        name: "产品目录右菜单",
        selected: "包装运输"
      }, 'Container', this.vueparams);
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/product/ProductAction/productTransportUp?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      productTransportUpSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/psi/product/ProductAction/productTransportUpSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.gotoPage("/psi/product/ProductTransport/productTransport?" + this.vueparams, data);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
    },
  }
</script>
